<?php if ($products) { ?>
<div class="product-filter">
    <a href="<?php echo $compare; ?>" id="compare-total"><?php echo $text_compare; ?></a>
    <div class="limit"><b><?php echo $text_limit; ?></b>
      <select onchange="location = this.value;">
        <?php foreach ($limits as $limits) { ?>
        <?php if ($limits['value'] == $limit) { ?>
        <option value="<?php echo $limits['href']; ?>" selected="selected"><?php echo $limits['text']; ?></option>
        <?php } else { ?>
        <option value="<?php echo $limits['href']; ?>"><?php echo $limits['text']; ?></option>
        <?php } ?>
        <?php } ?>
      </select>
    </div>
    <div class="sort"><b><?php echo $text_sort; ?></b>
      <select onchange="location = this.value;">
        <?php foreach ($sorts as $sorts) { ?>
        <?php if ($sorts['value'] == $sort . '-' . $order) { ?>
        <option value="<?php echo $sorts['href']; ?>" selected="selected"><?php echo $sorts['text']; ?></option>
        <?php } else { ?>
        <option value="<?php echo $sorts['href']; ?>"><?php echo $sorts['text']; ?></option>
        <?php } ?>
        <?php } ?>
      </select>
    </div>
  </div>
  
  <div class="product-grid">
    <?php foreach ($products as $product) { ?>
        <div class="product-carousel-item">
         <?php if ($product['special']) { ?>
            <div class="promo-flag">
                <div><?php echo $label_promo; ?></div>
            </div>
          <?php } ?>
          <?php if ($product['stock']) { ?>
            <div class="promo-flag">
                <div><?php echo $product['stock'] ?></div>
            </div>
          <?php } ?>
          
            <a href="<?php echo $product['href']; ?>">
                <img class="product-image" src="<?php echo $product['thumb']; ?>" title="<?php echo $product['name']; ?>" alt="<?php echo $product['name']; ?>" />
            
            <p class="product-description"><?php echo $product['name']; ?></p>
            <span class="product-model">#<?php echo $product['model']; ?></span>
            </a>
            <div class="row cf">
                <div class="price-description">
                <p>
                <?php if (!$product['special']) { ?>
                <?php echo $product['price']; ?>
                <?php } else { ?>
                    <span class="promo"><?php echo $product['price']; ?></span><?php echo $product['special']; ?>
                <?php } ?>
                    </p>
                </div>   
                <div class="buy">
                    <button class="buy-button" value="<?php echo $button_cart; ?>" onclick="addToCart('<?php echo $product['product_id']; ?>');"><span><?php echo $button_cart; ?></span></button>
                    

                </div>
            </div>
        </div> <!--# product tile example-->

    
    
    <?php } ?>
  </div>
  <div class="pagination"><?php echo $pagination; ?></div>
<?php } ?>